Skip to content

mcpx: generate the public client signature reference from source - #13701

Merged
dezren39 merged 2 commits into
mainfrom
queue/21410-13612-public-client-surface
Nov 24, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/21410-13612-public-client-surface

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

Replaces the hand-written signature table in pkgs/mcpx/docs/public-client.md with a region generated from the pkg/client Go source, added to the existing committed-docs golden check.

Why

The table drifted — several ctx descriptions were stale and the receiver shapes were spelled loosely. Generating it from source means a new, removed or reshaped exported callable drifts the check instead of the docs.

Fixes #13612

How

  • internal/refdoc/clientsurface.go: ClientSurface(files map[string][]byte) parses the source, renders exported types, package funcs and methods on exported receivers with the doc-comment first paragraph as the summary; unexported names, bodies, struct fields and package vars are excluded; output is deterministically sorted.
  • internal/refdoc/clientsurface_test.go: exact-render pin, drift table (parameter type/name, receiver, result, type params, removal, addition, type kind), preservation table (bodies, fields, unexported, package var), determinism.
  • internal/refdoc/regions_test.go: public-client-signatures region added to TestCommittedRegionsAreCurrent.
  • pkg/client/client.go: doc comments on (*ArgError).Error and (*HTTPError).Error so no summary is empty.

Verification

cd pkgs/mcpx && go test ./internal/refdoc ./pkg/client -count=1 (local), plus -race -shuffle=on -count=5 on refdoc. Focused Fleet dispatch result recorded in the issue thread.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T20:53:28Z",
    "session_id": "ses_e5df6002d55ffe0A3TqeHqMEcI",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/fleet/code-f-21410-public-client",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/fleet/code-f-21410-public-client",
      "repo": "developing-today/code",
      "branch": "queue/21410-13612-public-client-surface",
      "sha": "b1cb58a80e93729de7a18c1263563a9fd1d34b07"
    },
    "auth_subject": "oc-code-05",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The public-client chapter carried a hand table of the pkg/client
surface that had drifted: several ctx descriptions were stale and
the receiver shapes were spelled loosely. Replace it with a generated
region built from the Go AST (types, funcs and methods on exported
receivers, doc-comment first paragraph as the summary), so a new,
removed or reshaped exported callable drifts the committed-docs
check.

The renderer is deterministic and excludes unexported names, bodies,
struct fields and package vars. Fixture tests pin an exact render and
drive the drift table (parameter type/name, receiver, result, type
params, removal, addition, type kind) and the preservation table
(bodies, fields, unexported, package var). Add the doc region to the
existing TestCommittedRegionsAreCurrent golden check.

Add doc comments to (*ArgError).Error and (*HTTPError).Error so no
generated summary is empty.

Fixes #13612
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fb4a5baa-30fe-44ab-a77f-b76ac32ee139
Commits

Reviewing files that changed from the base of the PR and between b9fd58c and 1ec1593.

Files selected for processing: 5

  • pkgs/mcpx/docs/public-client.md
  • pkgs/mcpx/internal/refdoc/clientsurface.go
  • pkgs/mcpx/internal/refdoc/clientsurface_test.go
  • pkgs/mcpx/internal/refdoc/regions_test.go
  • pkgs/mcpx/pkg/client/client.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

… A: resolve public-client.md hand-table vs generated region, keep generated)
@dezren39
dezren39 merged commit 3d519b0 into main Nov 24, 2026
1 check passed
@dezren39
dezren39 deleted the queue/21410-13612-public-client-surface branch November 24, 2026 03:08
@dezren39

Copy link
Copy Markdown
Member Author

Batch A merge (lane code-i, task 21622): merge-main-in 1ec1593 pushed (no force), verified, PR merged as 3d519b0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcpx docs: keep public Go client signatures in sync with their chapter

1 participant